/* ****************************************************************
   ****************************************************************
   * Com++ Professional (c) 2009 C++ World
   * http://www.cplusplusworld.com/ mailto:compp@cplusplusworld.com
   ****************************************************************
   ****************************************************************
*/


#ifndef  _PTHREADH
#define _PTHREADH


#include <pthread.h>

namespace compp {

class Thread {

private:

protected:

  pthread_t PThr_id;
  pthread_attr_t  *PAttr;

  void *Arguments;
  void InitPThr();

public:

  Thread() ;
  virtual ~Thread() ;
  Thread(void *arg) ;
  bool Start ( void *arg = NULL ) ;
  bool Join ( void ** valueptr = NULL );
  bool Detach();
  bool Terminate();

  void * StartThreadFunc( );
  virtual void * Run ( void *arg ) =0  ;
};
}

#endif
